home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
025a
/
prgmchk.zip
/
CHK.DOC
next >
Wrap
Text File
|
1991-07-23
|
2KB
|
50 lines
PARENTHESES AND QUOTES CHECKING ROUTINES
"Necessity is a mother..."
These two routines were written after a very aggravating session
of trying to track down the source of those gut-wrenching RBase
error messages like "missing ENDIF, ENDWHILE ...." when you know
you're not missing any. Using these EXE routines, you can quickly
do a ZIP RETURN ... or ZIP ROLLOUT ... and find the missing quote
or parenthesis.
----------------------------------
The PARENCHK routine expects the sets of parentheses to balance
by the end of each line unless it's a continued line (ends with
the RBase symbol, +). The output shows the line number and the
count of parentheses followed by the actual line where the
imbalance has occurred. The routine also looks for out-of-
sequence parentheses within a line (ie-when number of closings >
number of openings) and tags the location in the output. The
output can get a little messy, particularly while processing a
comment block but I think you'll find it useful.
The QUOTECHK routine is similar in concept; it attempts to pair
quotation marks on each line. It also allows for RBase
continuation lines before flagging an imbalance. In this
routine, I felt it was best to ignore full comment lines [those
starting with *( and ending with ) or starting with --] and also
to ignore the SET QUOTE commands. The routine checks for both
single and double quotes.
The fastest routines were written and compiled in QBASIC by the
version 4.0 compiler. I've also included the BASIC source code
to allow you to improve upon my meager coding skills or adapt it
to some other brand X software. For those who dislike ZIPping
outside of RBase, I've included much slower versions written in
RBase 3.1 command language which perform the same functions.
A return copy of any improvements would be gratifying (as would
be any royalties, honoraria or complementary beers).
William Driskell
6536 20 Ave NE
Seattle, Wa 98115